package controlador;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.WindowConstants;

import vista.vMenuPrincipal;


public class cMenuPrincipal implements ActionListener {

private  vMenuPrincipal menu;
	
	public cMenuPrincipal() {
		super();
		this.menu= new vMenuPrincipal();
		this.menu.setLocationRelativeTo(null);
		this.menu.setVisible(true);	
		this.menu.addListener(this);
		
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		String actionCommand = e.getActionCommand();
		
		if (actionCommand.equals("Salir")) {
			menu.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		}
		else if (actionCommand.equals("Registrar Categoria")) {
			new cCategoria();
		}
		else if(actionCommand.equals("Registrar Producto"))
		{
			new cProducto();
		}
		else if(actionCommand.equals("Registrar Orden De Compra"))
		{
			new cOrdenCompra();
		}else if (actionCommand.equals("Registrar Compra")){
			new cCompra();
		}
		else if(actionCommand.equals("Ingredientes Disponibles"))
		{
		new cLIngredienteDis();
		}else if(actionCommand.equals("Ventas Por Productos"))
		{
			new cLVentaporProducto();
		}
	}
}
